package com.llynosy.interview.po;

import javax.persistence.Column;
import javax.persistence.Table;
import java.io.Serializable;

@Table(name="tb_problem_tag")
public class ProblemTag implements Serializable {
    @Column(name = "problemId")
    private Long problemId;
    @Column(name = "tagId")
    private Long tagId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ProblemTag that = (ProblemTag) o;

        if (problemId != null ? !problemId.equals(that.problemId) : that.problemId != null) return false;
        return tagId != null ? tagId.equals(that.tagId) : that.tagId == null;
    }

    public ProblemTag() {
    }

    public ProblemTag(Long problemId, Long tagId) {

        this.problemId = problemId;
        this.tagId = tagId;
    }

    @Override
    public int hashCode() {
        int result = problemId != null ? problemId.hashCode() : 0;
        result = 31 * result + (tagId != null ? tagId.hashCode() : 0);
        return result;
    }

    public Long getProblemId() {
        return problemId;
    }

    public void setProblemId(Long problemId) {
        this.problemId = problemId;
    }

    public Long getTagId() {
        return tagId;
    }

    public void setTagId(Long tagId) {
        this.tagId = tagId;
    }
}
